]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
iconGrid: Only add one onComplete callback for the animations
authorJonas Dreßler <verdre@v0yd.nl>
Thu, 8 Aug 2019 22:18:38 +0000 (00:18 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Fri, 16 Aug 2019 14:55:25 +0000 (14:55 +0000)
We only need a callback on the last animated actor, so no need to
register the callback for all actors.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/678

js/ui/iconGrid.js

index 1fbf416c5f181f6e4e81be8d3e134765a1d536f5..e0a1e8bd8ab5879a3364589016cf99a25b8dba19 100644 (file)
@@ -545,12 +545,12 @@ var IconGrid = GObject.registerClass({
                     scale_y: 1,
                     duration: ANIMATION_TIME_IN,
                     mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD,
-                    delay,
-                    onComplete: () => {
-                        if (isLastItem)
-                            this._animationDone();
-                    }
+                    delay
                 };
+
+                if (isLastItem)
+                    movementParams.onComplete = this._animationDone.bind(this);
+
                 fadeParams = {
                     opacity: 255,
                     duration: ANIMATION_FADE_IN_TIME_FOR_ITEM,
@@ -571,13 +571,12 @@ var IconGrid = GObject.registerClass({
                     scale_y: scaleY,
                     duration: ANIMATION_TIME_OUT,
                     mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD,
-                    delay,
-                    onComplete: () => {
-                        if (isLastItem) {
-                            this._animationDone();
-                        }
-                    }
+                    delay
                 };
+
+                if (isLastItem)
+                    movementParams.onComplete = this._animationDone.bind(this);
+
                 fadeParams = {
                     opacity: 0,
                     duration: ANIMATION_FADE_IN_TIME_FOR_ITEM,